import java.util.Scanner;

public class text3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数：");
        int Max = sc.nextInt();
        for(int i=1;i<Max;i++){
            int sum = 0;
            int temp = i;
           for(int j=1;j<i;j++){
               if(temp%j==0){
                   sum += j;
               }
           }
            if(sum == i){
                System.out.println(i);
            }
        }
        sc.close();
    }
}
